package Structural.Flyweight.demo1;

/*享元模式*/
public class FlyweightDemo1 {
	public static void main(String[] args) {
		String s1 = "abc";
		String s2 = "abc";
		String s3 = new String("abc");
		String s4 = new String("abc");

		// T
		System.out.println(s1 == s2);
		// F
		System.out.println(s1 == s3);
		// F
		System.out.println(s3 == s4);
		// T
		System.out.println(s1 == s3.intern());
		// T
		System.out.println(s3.intern() == s4.intern());
	}

}
